import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/system/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/system/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/system/user/logout',
    method: 'get'
  })
}

/**
 * {"userName":"用户名","passWord":"密码","avatar":"网络头像"}
 */
export function add(data) {
  return request({
    url: '/system/user/add',
    method: 'post',
    data
  })
}

export function all() {
  return request({
    url: '/system/user/all',
    method: 'get'
  })
}
